
// // 首行是表示有几行输入
// var readline = require('readline');

// let rows = [];
// let k = -1;
// const rl = readline.createInterface({
//   input: process.stdin,
//   output: process.stdout
// })

// rl.on('line', line => {
//   if (k == -1) {
//     k = parseInt(line.trim());
//   } else {
//     rows.push(line);
//     if (k == rows.length) {


//       rows.forEach(li => {
//         let numArr = li.split(' ').map(item => parseInt(item));
//         let sum = 0;
//         numArr.forEach((it) => {
//           sum += it;
//         })
//         console.log(sum);



//       })
//       rl.close();
//     }
//   }
// })


// 遇到0结束
var readline = require('readline');

let rows = [];
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
})

rl.on('line', line => {
  rows.push(line);
  if (rows[rows.length - 1] === '0') {
    rows.pop();
    rows.forEach(li => {
      // let numArr = li.split(' ')
      // console.log(numArr);
      console.log(li);
      console.log(calculate(li));
      // 算法代码写在这里
    })
    rl.close();
  }
})

var calculate = function(s) {
  let sign = '+', n = 0, c, stack = [];
  for (let i = 0; i <= s.length; i++) {
    c = s[i];
    if (c === ' ') continue;
    if (c <= '9' && c >= '0') {
      n = n * 10 + parseInt(c);
      continue;
    }
    if (sign === '+') {
      stack.push(n);
    } else if (sign === '-') {
      stack.push(-n);
    } else if (sign === '*') {
      stack.push(stack.pop() * n)
    } else if (sign === '/') {
      stack.push(stack.pop() / n)
    }
    sign = c;
    n = 0;
  }
  return stack.reduce((acc, n) => acc + n, 0).toFixed(2);
};
